package com.wcy.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wcy.mapper.WorkIssueMapper;
import com.wcy.domain.WorkIssue;
import com.wcy.service.WorkIssueService;
import org.springframework.util.StringUtils;

/**
 * <p>Title:WorkIssueServiceImpl.java</p >
 * <p>Description: </p >
 * <p>Copyright: 公共服务与应急管理战略业务本部 Copyright(c)2020</p >
 * <p>Date:2021/9/18 22:14</p >
 *
 * @author wcy (wangchaoyanga@mail.taiji.com.cn)
 * @version 1.0
 */
@Service
public class WorkIssueServiceImpl extends ServiceImpl<WorkIssueMapper, WorkIssue> implements WorkIssueService{

    @Override
    public Page<WorkIssue> findByPage(Page<WorkIssue> page, String startTime, String endTime, Integer status) {
        return page(page,new LambdaQueryWrapper<WorkIssue>()
                .between(!StringUtils.isEmpty(startTime)&&!StringUtils.isEmpty(endTime),WorkIssue::getCreated,startTime,endTime+" 23:59:59")
                .eq(status != null,WorkIssue::getStatus,status)
        );
    }
}
